package xcmg.device.dao.mapper.abnormal;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.abnormal.AbnormalOutDetailDO;
import xcmg.device.service.vo.abnormal.AbnormalOutDetailVO;
import xcmg.device.service.vo.boxup.BoxupDetailVO;
import xcmg.device.service.vo.boxup.BoxupMaterialsQuery;
import xcmg.device.service.vo.delivery.BillDetailMaterialsVO;
import xcmg.device.service.vo.delivery.BoxUpDeliveryNoteVO;

import java.util.List;

@Mapper
public interface AbnormalOutDetailMapper {

    int deleteByPrimaryKey(@Param("id") String id);

    int delete(@Param("abnormalNo") String abnormalNo);

    int add(AbnormalOutDetailDO record);

    AbnormalOutDetailDO selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(AbnormalOutDetailDO abnormalOutDetailDO);
    List<AbnormalOutDetailDO> list(@Param("AbnormalNo") String AbnormalNo);

    List<AbnormalOutDetailDO> listForLocationUser(@Param("AbnormalNo") String AbnormalNo);

    int remove(@Param("ids") List<String> ids);

    List<AbnormalOutDetailDO> listAll(AbnormalOutDetailVO abnormalOutDetailVO);

    int removeByInOrderList(@Param("orderList") List<String> orderList, @Param("orgId") String orgId);

    int updateStatus(@Param("status") Integer status, @Param("billNo") String billNo,@Param("materialsNo") String materialsNo, @Param("orgId") String orgId);

    List<BillDetailMaterialsVO> moreBillDetail(@Param("deliveryBillId")String deliveryBillId);

    BoxUpDeliveryNoteVO itemByNoAndMaterialsNo(@Param("orgId")String orgId, @Param("deliveryNoteNo")String deliveryNoteNo, @Param("materialsNo") String materialsNo);


    List<BoxupDetailVO> notPackList(BoxupMaterialsQuery boxupMaterialsQuery);

    AbnormalOutDetailDO getByMaterialsNo(@Param("materialsNo") String materialsNo,
        @Param("abnormalNo") String abnormalNo);

    int updatePostAmount(@Param("businessOrder") String businessOrder, @Param("materialNo")String materialNo , @Param("orgId") String orgId, @Param("voucherNo")String voucherNo);

    int findPostStatus(@Param("billNo")String billNo);

    int updatePostStatus(@Param("billNo")String billNo, @Param("postStatus")int postStatus);

    int updateVoucherNoNone(@Param("billNo") String billNo, @Param("materialsNo") String materialsNo);

    List<AbnormalOutDetailDO> exportListForLocationUser(@Param("AbnormalNo") String AbnormalNo);

    List<AbnormalOutDetailDO> getMaterialInfoByNo(List<String> billNoList);
}
